// 导入fs模块
import fs from 'fs'
const p1 = new Promise((resolve, reject) => {
    fs.readFile('./txt/a.txt', 'utf8', (err,data)=> {
    resolve(data)//不做判断,不考虑错误情况
    })
})
// 创建Promise对象
const p2 = new Promise((resolve, reject) => {
    fs.readFile('./txt/b.txt', 'utf8', (err,data)=> {
        resolve(data)//不做判断,不考虑错误情况
    })
})
const p3 = new Promise((resolve, reject) => {
    fs.readFile('./txt/c.txt', 'utf8', (err,data)=> {
        resolve(data)//不做判断,不考虑错误情况
    })
})
p1.then(res => {
    console.log(res);
    
    return p2
}).then(res => {
    console.log(res);
    return p3
}).then(res => {
    console.log(res);
})